/**
 * 
 */
package cz.cuni.mff.abacs.burglar.logics.objects;

import cz.cuni.mff.abacs.burglar.logics.DataMap;


/** 
 * Base object of the game elements.
 * 
 * Immutable class.
 * 
 * @author abacs
 *
 */
public abstract class BaseObject implements BaseInterface {
	
	
	/** type of the current object */
	private final Type _type;
	
	
	/** identifier of the object */
	private final int _id;
	
	/**  */
	protected final DataMap _referenceMap;
	
	
	// -------------------------------------------------------------------------
	// constructors:
	
	
	/**
	 * 
	 */
	protected BaseObject(int id, Type objectType, DataMap referenceMap) {
		this._type = objectType;
		this._id = id;
		this._referenceMap = referenceMap;
	}
	
	
	// -------------------------------------------------------------------------
	// BaseInterface:
	
	
	@Override
	public int getId() {
		return this._id;
	}
	
	
	@Override
	public Type getType() {
		return this._type;
	}
	
	
	@Override
	public boolean isTypeOf(Type compareTo) {
		return this._type == compareTo;
	}

}
